package edu.hhu.wifispark.task;

import java.util.Date;
import java.util.List;

import edu.hhu.wifispark.entry.BasePhone;
import edu.hhu.wifispark.task.sparktask.CFlowTask;
import edu.hhu.wifispark.util.DateUtil;


public class ObtainCFlow {

	public void start(){
		long nowtime = new Date().getTime();
		long endtime = DateUtil.getHour(nowtime);
		long station = endtime - 3600000;
		List<BasePhone> bps = BasePhone.dao.findToday(station, endtime);
		if(bps == null || bps.size() == 0){
			return;
		}
		CFlowTask cFlowTask = new CFlowTask(station);
		cFlowTask.setBps(bps);
		cFlowTask.start();
		try {
			cFlowTask.join();
		} catch (InterruptedException e) {
		}
	}
}
